/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package iteracon.generator.iterator;

import java.util.Iterator;

/**
 *
 * @author martin
 */
public class FromToIter implements Iterator<Integer> {
  private int _to,
                _now;

    public FromToIter(int from, int to){
      _now=from;
      _to=to;
    }
    
    @Override
    public boolean hasNext() {
      return _now+1 < _to;
    }

    @Override
    public Integer next() {
      int tmp = _now;
      _now = _now + 1;
      return tmp;
    }

    @Override
    public void remove() {
      throw new UnsupportedOperationException("Immutable");
    }
}
